package com.logictech.lims.web.api;

import java.util.ArrayList;
import java.util.List;

import org.jeecgframework.p3.core.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.logictech.lims.dto.PositionReq;
import com.logictech.lims.entity.Position;
import com.logictech.lims.service.PositionService;
import com.logictech.wechat.model.responseDto.JsonResp;

/**
 * 描述：</b>PositionController<br>
 * 
 * @author guoqi
 * @since：2017年03月21日 16时10分38秒 星期二
 * @version:1.0
 */
@Controller
@RequestMapping("/lims/api/position")
public class ApiPositionController extends BaseController {
	@Autowired
	private PositionService positionService;

	/**
	 * 获取位置列表
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping(value = { "/getPositionList" }, produces = "application/json",method = { org.springframework.web.bind.annotation.RequestMethod.GET,
			org.springframework.web.bind.annotation.RequestMethod.POST })
	@ResponseBody
    public JsonResp<List<Position>> getPositionList(@RequestBody PositionReq positionReq){
	    
		// 位置列表
		List<Position> positionList = new ArrayList();
		positionList = this.positionService.queryByType(positionReq.getStorageType());
		
        JsonResp<List<Position>> resp = new JsonResp<List<Position>>();
        resp.setInfo(positionList);
        return resp;
    }

}
